import api from './index'
import type { User } from '@/models/user.model'

// 定义表索引
export const TABLE_INDEX = {
  USERS: 0,
  ARTICLES: 1,
  COMMENTS: 4
}

// 用户注册
export const register = (userData: User) => {
  return api.post('/reg', userData)
}

// 用户登录
export const login = (username: string, password: string) => {
  return api.post('/login', { username, password })
}